//
//  AdoptTribalSelectedCell.m
//  PigMarket
//
//  Created by 张敬 on 2019/9/4.
//  Copyright © 2019年 pigmarket.oc. All rights reserved.
//

#import "AdoptTribalSelectedCell.h"

@implementation AdoptTribalSelectedCell

#pragma mark - lifecycle methods

- (void)setupUI{
    
    [self addSubview:self.titleLab];
    [self addSubview:self.detailLab];
    [self addSubview:self.icon];
}

- (void)setupLayout{
    
    self.height = 60;
    {
        _titleLab.size = CGSizeMake(KScreenWidth - 100, 18);
        _titleLab.mj_x = 30;
        _titleLab.mj_y = 10;
    }
    
    {
        _detailLab.size = CGSizeMake(KScreenWidth - 100, 18);
        _detailLab.mj_x = 30;
        _detailLab.mj_y = _titleLab.bottom + 5;

    }
    
    {
        _icon.size = CGSizeMake(16, 16);
        _icon.mj_x = KScreenWidth - _icon.width - 30;
        _icon.mj_y = (self.height - _icon.height)/2.0;
    }
    
    CAShapeLayer *line = [CAShapeLayer layer];
    line.fillColor = mBackgroudColor.CGColor;
    UIBezierPath *path = [UIBezierPath bezierPathWithRect:CGRectMake(30, 60, KScreenWidth - 60, 1)];
    line.path = path.CGPath;
    [self.layer addSublayer:line];
}

#pragma mark - setter methods
#pragma mark - getter methods

- (UILabel *)titleLab{
    
    if (!_titleLab) {
        _titleLab = [UILabel makeLabelWithText:@"" textColor:UIColorFromRGB(0x666666) font:mFont(13) textAliment:0];
    }
    return _titleLab;
}

- (UILabel *)detailLab{
    
    if (!_detailLab) {
        _detailLab = [UILabel makeLabelWithText:@"" textColor:mMainColor font:mFont(13) textAliment:0];
    }
    return _detailLab;
}

- (UIImageView *)icon{
    
    if (!_icon) {
        _icon = [UIImageView makeImageByImageName:@"adopt_down" cornerRadius:0];
    }
    return _icon;
}

@end
